package com.helloSpringBoot.po;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.UpdateTimestamp;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/*
hello表
 */
@Entity
@Table(name = "myhello",indexes = {@Index(columnList = "id")})
@Data
public class helloPo implements Serializable {
    @Id
    @GenericGenerator(name="idGenerator", strategy="uuid") //这个是hibernate的注解/生成32位UUID
    @GeneratedValue(generator="idGenerator")
    @Column(length = 50)
    @JsonIgnore
    private String id;

    @Column(columnDefinition = "longtext")
    private String htmlstr;


    @JsonIgnore
    @CreationTimestamp
    @Column(updatable = false)
    private Date createDate;
    @JsonIgnore
    @UpdateTimestamp
    private Date lastModifiedDate;


}
